import {defineStore} from '.././pinia'
import {ref,computed} from 'vue'

export const userStore = defineStore({
  id:'users',
  state:()=>{
    return {
      count:0
    }
  },
  getters:{
    dobule(){
      return this.count * 2
    }
  },
  actions:{
    increment(){
      this.count +=2
    }
  }
})

export const setupStore = defineStore('setupStore',()=>{
  const count = ref(0)
  const double = computed(()=>{
    return count.value * 2
  })
  const increment = ()=>{
    count.value += 2
  }

  return {count,double,increment}
})